<?php
// +----------------------------------------------------------------------
// | quanli team
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2020 http://www.fistforward.com/ All rights reserved.
// +----------------------------------------------------------------------
// | Author: create by allen.qiang
// +----------------------------------------------------------------------

/**
 * 会员反馈ajax类
 * @package  ajax
 * @subpackage  backend
 * @author   create by allen.qiang
 */

quanli_require('module/base/customer/custComment.class.php');

class ajax_custComment{

    public function execute(){

        if( isset($_REQUEST['operFlg']) && quanli_is_int($_REQUEST['operFlg'])){

            switch( $_REQUEST['operFlg'] ){

                case 1:
                    $this->saveCustComment();//保存反馈信息
                    break;

                default:
                    returnJsonData('参数错误');
                    break;

            }

        } else{

            returnJsonData('参数错误');

        }

    }

  
    /**
     * 保存反馈信息
     */
    public function saveCustComment(){

        global $G_SHOP;

        $_REQUEST['ip'] = get_ip();
        $_REQUEST['session_id'] = session_id();

        //实例化会员反馈类
        $custComment = new custComment();


        //新增/修改
        $arg_array = $_REQUEST;
        $arg_array['creator'] = $G_SHOP->currentCustomerID;
        $result_array = $custComment->saveCustComment( $arg_array );
        returnJsonData($result_array['message'],$result_array['code']);

    }

}


